| Fully Qualified Name: | CodeIgniter\Test\CIDatabaseTestCase |
| Extends: | CIUnitTestCase |
CIDatabaseTestCase
| Name | Description | Defined By |
|---|---|---|
| assertCloseEnough() | Custom function to test that two values are "close enough". | CIUnitTestCase |
| assertCloseEnoughString() | Custom function to test that two values are "close enough". | CIUnitTestCase |
| assertEventTriggered() | Hooks into CodeIgniter's Events system to check if a specific event was triggered or not. | CIUnitTestCase |
| assertHeaderEmitted() | Hooks into xdebug's headers capture, looking for a specific header emitted | CIUnitTestCase |
| assertHeaderNotEmitted() | Hooks into xdebug's headers capture, looking for a specific header emitted | CIUnitTestCase |
| assertLogged() | Custom function to hook into CodeIgniter's Logging mechanism to check if certain messages were logged during code execution. | CIUnitTestCase |
| dontSeeInDatabase() | Asserts that records that match the conditions in $where do not exist in the database. | CIDatabaseTestCase |
| grabFromDatabase() | Fetches a single column from a database row with criteria matching $where. | CIDatabaseTestCase |
| hasInDatabase() | Inserts a row into to the database. This row will be removed after the test has run. | CIDatabaseTestCase |
| loadDependencies() | Load any database test dependencies. | CIDatabaseTestCase |
| seeInDatabase() | Asserts that records that match the conditions in $where DO exist in the database. | CIDatabaseTestCase |
| seeNumRecords() | Asserts that the number of rows in the database that match $where is equal to $expected. | CIDatabaseTestCase |
| seed() | Seeds that database with a specific seeder. | CIDatabaseTestCase |
Custom function to test that two values are "close enough".
This is intended for extended execution time testing, where the result is close but not exactly equal to the expected time, for reasons beyond our control.
| Parameter Name | Type | Description |
|---|---|---|
| $expected | int | |
| $actual | mixed | |
| $message | string | |
| $tolerance | int |
Returns:
Custom function to test that two values are "close enough".
This is intended for extended execution time testing, where the result is close but not exactly equal to the expected time, for reasons beyond our control.
| Parameter Name | Type | Description |
|---|---|---|
| $expected | mixed | |
| $actual | mixed | |
| $message | string | |
| $tolerance | int |
Returns: bool
Hooks into CodeIgniter's Events system to check if a specific event was triggered or not.
| Parameter Name | Type | Description |
|---|---|---|
| $eventName | string |
Returns: bool
Hooks into xdebug's headers capture, looking for a specific header emitted
| Parameter Name | Type | Description |
|---|---|---|
| $header | string | The |
| $ignoreCase | bool |
Returns:
Hooks into xdebug's headers capture, looking for a specific header emitted
| Parameter Name | Type | Description |
|---|---|---|
| $header | string | The |
| $ignoreCase | bool |
Returns:
Custom function to hook into CodeIgniter's Logging mechanism to check if certain messages were logged during code execution.
| Parameter Name | Type | Description |
|---|---|---|
| $level | string | |
| $expectedMessage | null |
Returns: bool
Asserts that records that match the conditions in $where do not exist in the database.
| Parameter Name | Type | Description |
|---|---|---|
| $table | string | |
| $where | array |
Returns: bool
Fetches a single column from a database row with criteria matching $where.
| Parameter Name | Type | Description |
|---|---|---|
| $table | string | |
| $column | string | |
| $where | array |
Returns: bool
Inserts a row into to the database. This row will be removed after the test has run.
| Parameter Name | Type | Description |
|---|---|---|
| $table | string | |
| $data | array |
Returns: bool
Load any database test dependencies.
Returns:
Asserts that records that match the conditions in $where DO exist in the database.
| Parameter Name | Type | Description |
|---|---|---|
| $table | string | |
| $where | array |
Returns: bool
Asserts that the number of rows in the database that match $where is equal to $expected.
| Parameter Name | Type | Description |
|---|---|---|
| $expected | int | |
| $table | string | |
| $where | array |
Returns: bool
Seeds that database with a specific seeder.
| Parameter Name | Type | Description |
|---|---|---|
| $name | string |
Returns: